package com.heny.demo.strategy;

import com.heny.demo.entity.TurnPointPOJO;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * @author litao.cc
 * @version FileProcessorStrategy.java v0.1 t2025/4/24 1:33
 * @date 2025/4/24 1:33
 * @description 文件处理策略接口
 */
public interface FileProcessorStrategy {
    List<TurnPointPOJO> processFile(MultipartFile turnPointFile);

    static TurnPointPOJO buildPOJO(String[] values) {
        TurnPointPOJO row = new TurnPointPOJO();
        if (values.length == 4) {
            row.setIndex(values[0]);
            row.setX(Double.parseDouble(values[1]));
            row.setY(Double.parseDouble(values[2]));
            row.setZ(Double.parseDouble(values[3]));
            return row;
        } else {
            return null;
        }


    }
}
